home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cuj9205.zip / 1005070A < prev    next >
Text File  |  1992-06-02  |  1KB  |  45 lines

  1. /* Listing 8 */
  2.  
  3. /*****************************************************
  4.     DMA.H
  5.  
  6.     Header file containing basic number defs and 
  7.     function prototypes for working with the DMA 
  8.     controller.
  9.  
  10.     Copyright Don Bradley, 1991.
  11.  
  12.     Permission is granted for used of these routines
  13.     in any manner as long as this copyright notice is
  14.     included.
  15.  
  16.     Tested using Quick C 2.5 and MSC 6.0 on a 
  17.     Toshiba T5200.
  18.  
  19.  *****************************************************/
  20.  
  21. #define TRUE        1
  22. #define FALSE       0
  23.  
  24. /* mask defines */
  25. #define DMA_ENABLE              0x00
  26. #define DMA_DISABLE             0x04
  27. #define DMA_DEMAND_MODE         0x00
  28. #define DMA_SINGLE_MODE         0x40
  29. #define DMA_ADDRESS_INC         0x00
  30. #define DMA_ADDRESS_DEC         0x20
  31. #define DMA_CONTINUOUS_ENABLE   0x10
  32. #define DMA_CONTINUOUS_DISABLE  0x00
  33. #define DMA_ADC_TRANSFER        0x04
  34. #define DMA_DAC_TRANSFER        0x08
  35.  
  36. int dma(int dma_channel, int mode, int far *buffer, 
  37.     unsigned int buffer_len);
  38. void disable_dma(int chan);
  39. void enable_dma(int chan);
  40. int far *alloc_dma_buffer(int dma_chn, 
  41.     unsigned int size);
  42. void free_dma_buffer(int dma_chn);
  43.  
  44.     
  45.